<?php
/**
 * Created by PhpStorm.
 * User: ivi
 * Date: 2019/2/19
 * Time: 20:48
 */

namespace App\Http\Requests\Admin;


use App\Http\Requests\BaseFormRequest;

class LoginFormRequest extends BaseFormRequest
{
    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        return [
            'username' => ['required', 'string', 'between:1,100', 'regex:/[a-zA-Z0-9_\x00-\xff]{4,100}/'],
            'password' => ['required', 'string', 'between:6,255'],
            'captcha' => ['required', 'captcha']
        ];
    }


    public function messages()
    {
        return __('system.user.validation');
    }
}
